﻿
@{
    Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml";
}

<body class="index">
    <!-- 顶部开始 -->
    <div class="container">
        <div class="logo">
            <a href="@Url.Action("Index","Home",new { area="Admin"})">后台管理</a>
        </div>
        <div class="left_open">
            <a><i title="展开左侧栏" class="iconfont">&#xe699;</i></a>
        </div>

        <ul class="layui-nav right" lay-filter="">
            <li class="layui-nav-item">
                <a href="javascript:;">@ViewData["name"]</a>
                <dl class="layui-nav-child">
                    <!-- 二级菜单 -->
                    <dd>
                        <a onclick="xadmin.open('修改密码','@Url.Action("Repwd","Home",new { area = "admin"})',700,600)">修改密码</a>
                    </dd>
                    <dd>
                        <a href="javascript:;" onclick="Logout()">退出</a>
                    </dd>
                </dl>
            </li>
            <li class="layui-nav-item to-index">
                <a href="/">前台首页</a>
            </li>
        </ul>
    </div>
    <!-- 顶部结束 -->
    <!-- 中部开始 -->
    <!-- 左侧菜单开始 -->
    <div class="left-nav">
        <div id="side-nav">
            <ul id="nav">
                @using yiran.Areas.Admin.Models.Entity
                @foreach (var menu in ViewData["menu"] as List<sys_menu>)
                {
                    @if (menu.parent_id == 0)
                    {
                        <li>
                            <a href="javascript:;">
                                <i class="iconfont left-nav-li" lay-tips="@menu.name">@Html.Raw(@menu.icon)</i>
                                <cite>@menu.name</cite>
                                <i class="iconfont nav_right">&#xe6a6;</i>
                            </a>
                            <ul class="sub-menu">
                                @foreach (var submenu in (ViewData["menu"] as List<sys_menu>).Where(c => c.parent_id == menu.id))
                                {
                                    @if (string.IsNullOrEmpty(submenu.action))
                                    {
                                        <li>
                                            <a onclick="xadmin.add_tab('@submenu.name','@submenu.path','@menu.name')">
                                                <i class="iconfont">&#xe6a7;</i>
                                                <cite>@submenu.name</cite>
                                            </a>
                                        </li>
                                    }
                                }
                            </ul>
                        </li>
                    }
                }


            </ul>
        </div>
    </div>
    <!-- <div class="x-slide_left"></div> -->
    <!-- 左侧菜单结束 -->
    <!-- 右侧主体开始 -->
    <div class="page-content">
        <div class="layui-tab tab" lay-filter="xbs_tab" lay-allowclose="false">
            <ul class="layui-tab-title">
                <li class="home">
                    <i class="layui-icon">&#xe68e;</i>我的桌面
                </li>
            </ul>
            <div class="layui-unselect layui-form-select layui-form-selected" id="tab_right">
                <dl>
                    <dd data-type="this">关闭当前</dd>
                    <dd data-type="other">关闭其它</dd>
                    <dd data-type="all">关闭全部</dd>
                </dl>
            </div>
            <div class="layui-tab-content">
                <div class="layui-tab-item layui-show">
                    <iframe src='@Url.Action("Index","Welcome",new { area="Admin"})' frameborder="0" scrolling="yes" class="x-iframe"></iframe>
                </div>
            </div>
            <div id="tab_show"></div>
        </div>
    </div>
    <div class="page-content-bg"></div>
    <style id="theme_style"></style>
    <!-- 右侧主体结束 -->
    <!-- 中部结束 -->
    <script>
        function Logout() {
            layer.confirm('确定要离开嘛？', function (index) {
                $.get("@Url.Action("Logout","Login",new { area="Admin"})", function (data) {
                    layer.msg(data.result, {
                        icon: 1,
                        time: 2000
                    }, function () {
                        location.reload();
                    });
                })
            });
        }
    </script>
</body>
